package com.tomehay.termprojectmanage_server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tomehay.termprojectmanage_server.enums.ResponseCode;
import com.tomehay.termprojectmanage_server.mapper.TaskGradesMapper;
import com.tomehay.termprojectmanage_server.pojo.Model.Evaluations;
import com.tomehay.termprojectmanage_server.mapper.EvaluationsMapper;
import com.tomehay.termprojectmanage_server.pojo.Model.TaskGrades;
import com.tomehay.termprojectmanage_server.pojo.VO.GradeVO;
import com.tomehay.termprojectmanage_server.pojo.VO.ResultVO;
import com.tomehay.termprojectmanage_server.service.EvaluationsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
@Service
public class EvaluationsServiceImpl extends ServiceImpl<EvaluationsMapper, Evaluations> implements EvaluationsService {
    @Resource
    EvaluationsMapper evaluationsMapper;



    public ResultVO<List<GradeVO>> querygrades(int id){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("group_task_id",id);
        List<GradeVO> gradeVOS = evaluationsMapper.findNextNo(id);
        return new ResultVO<>(ResponseCode.auto(gradeVOS),gradeVOS);
    }
}
